﻿#if UNITY_EDITOR
using System;
/// <summary>
/// 编辑器资源
/// </summary>
public abstract class AbsESF_EditorAsset<T> : IDisposable
    where T : AbsESF_EditorAsset<T>
{
    #region Dispose
    /// <summary>
    /// 销毁前事件
    /// </summary>
    public Action<T> OnBeforeDispose;
    /// <summary>
    /// 销毁后事件
    /// </summary>
    public Action<T> OnAfterDispose;
    /// <summary>
    /// Disposes
    /// </summary>
    public void Dispose()
    {
        OnBeforeDispose?.Invoke((T)this);
        OnDispose();
        OnAfterDispose?.Invoke((T)this);
    }
    /// <summary>
    /// Disposes
    /// </summary>
    protected virtual void OnDispose() { }
    #endregion
}
#endif
